package com.aaa.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter
public class Demo01Filter implements Filter {


    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("A");
//        多个过滤器形成过滤器链通过名字来决定排序
//        调用下一个过滤器，等下一个过滤器过滤结束后在执行后续,然后在进行放行如果不放行则不会执行后续
        chain.doFilter(request,response);
        System.out.println("B");
    }
}
